]> dgit.raspbian.org Git - gnome-shell.git/commit
slider: Align handle size with with pixel grid
authorSebastian Keller <skeller@gnome.org>
Sun, 23 Feb 2025 11:15:52 +0000 (12:15 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 19 Mar 2025 20:44:08 +0000 (20:44 +0000)
commit8191d1d5798d3eca447a23549762659618075d93
tree4cea08726a3ec6479d4ca7295b85a84a4327260e
parent8447292e7e186f79b8eb8627072d18b8eb459588
slider: Align handle size with with pixel grid

Since the handle radius is used to calculate the width and height of the
slider, having the calculated size be a non-integer value can cause the
following widgets in a box-like container to be unaligned with the pixel
grid, which can lead to blurriness or other visual issues.

This for example could be observed with the interface font set to
"Cantarell 12", which results in a handle radius of 8.278. In quick
settings when showing two consecutive sliders, the second slider then
gets rendered at a non-integer vertical offset.

Further having a non-integer size for a StDrawingArea can cause the
texture to get slightly squished or stretched as the size of the cairo
surface is rounded to the nearest pixel, but rendered using the
unrounded actor size.

This commit changes the border radius rather than ceiling the preferred
width/height so that the handle size always matches the width or height
of the widget and there are no visual gaps caused by a partially filled
pixel.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3648>
js/ui/slider.js